package Package;

import Package.dao.HelloSpring5;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

//第6章 Spring入门程序
public class IntroductionCase {
    public static void main(String[] args) {

        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("ApplicationContext.xml");

        //setter注入
//        HelloSpring5 helloSpring5 = (HelloSpring5) applicationContext.getBean("helloSetter");

        //构造器注入
        HelloSpring5 helloSpring5 = (HelloSpring5) applicationContext.getBean("helloConstructor");
        helloSpring5.show();
    }
}
